package com.googlecode.wmlynar.javadoctc.domain;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;

/**
 * Represents a class documented with javadoc.
 * 
 * @author Wojciech Mlynarczyk (woj)
 * 
 */
public class JavaDocClass {
	
	private String name;
	private ArrayList<JavaDocMethod> methods = new ArrayList<JavaDocMethod>();
	private HashMap<String, JavaDocMethod> methodMap = new HashMap<String, JavaDocMethod>();
	
	public JavaDocClass(String name) {
		this.name = name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	public String getName() {
		return name;
	}
	
	public void addMethod(JavaDocMethod clas) {
		methods.add(clas);
		methodMap.put(clas.getName(), clas);
	}
	
	public List<JavaDocMethod> getMethodList() {
		return Collections.unmodifiableList(methods);
	}
	
	public JavaDocMethod getMethodByName(String name) {
		return methodMap.get(name);
	}

}

